package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ScoreActivity extends AppCompatActivity {
    TextView out;
    private static final String TAG="ScoreActivity";
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score);
    }

    public void myclick(View btn){
        out = findViewById(R.id.text2);
        int a = Integer.parseInt(out.getText().toString());
        Log.i(TAG, "myclick: 111");
       if(btn.getId()==R.id.btn){
           int b = a+3;
           String c=String.valueOf(b);
           out.setText(c);
       }else if(btn.getId()==R.id.btn2){
           int b = a+2;
           String c=String.valueOf(b);
           out.setText(c);
       }else if(btn.getId()==R.id.btn3){
           int b = a+1;
           String c=String.valueOf(b);
           out.setText(c);
       }else {
           String c=String.valueOf(a);
           out.setText(c);
       }
   }

    public void myclick1(View btn){
        out = findViewById(R.id.text4);
        int a = Integer.parseInt(out.getText().toString());
        if(btn.getId()==R.id.btn5){
            int b = a+3;
            String c=String.valueOf(b);
            out.setText(c);
        }else if(btn.getId()==R.id.btn6){
            int b = a+2;
            String c=String.valueOf(b);
            out.setText(c);
        }else if(btn.getId()==R.id.btn7){
            int b = a+1;
            String c=String.valueOf(b);
            out.setText(c);
        }else {
            String c=String.valueOf(a);
            out.setText(c);
        }
    }
    public void myclick2(View v){
        Log.i("main","click1:1");
        TextView text1 = findViewById(R.id.text2);
        TextView text2 = findViewById(R.id.text4);

        Log.i("main","click1:2");
        text1.setText("0");
        text2.setText("0");
    }
}